package com.smh.aiagent.demo.invoke;

import dev.langchain4j.community.model.dashscope.QwenChatModel;
import dev.langchain4j.data.message.SystemMessage;
import dev.langchain4j.data.message.UserMessage;
import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.chat.response.ChatResponse;

/**
 * @author shiminghui
 * @date 2025/5/29 21:36
 * @description: TODO
 */
public class LangChainAiInvoke {
    public static void main(String[] args) {
        ChatModel qwenModel = QwenChatModel.builder()
                .apiKey(TestApiKey.API_KEY)
                .modelName("qwen-max")
                .build();
        ChatResponse chatResponse = qwenModel.chat(new SystemMessage("你是一个ai助手,帮用户完成编程相关的工作"),
                new UserMessage("你好啊"));
        System.out.println(chatResponse.aiMessage().text());


    }
}
